<div id="supplier-contain" class="ui-widget">
<div><span><b>当前位置:</b></span><?php echo '<b>&nbsp;&nbsp;'.$result_supplier_name.'</b>'?></div>
<table id="category" class="ui-widget ui-widget-content">
	<thead>
		<tr class="ui-widget-header ">
			<th><input type="checkbox" onclick="changeSelectAll(this,'checkSubKey');"></th>
			<th>套餐名称</th>
			<th>价钱</th>
			<th>菜色</th>
			<th>图片</th>
			<th>描述</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
	<?php
	foreach ($result_bunddle as $item) {
		echo '<tr><td><input type="checkbox" class="checkSubKey" key="'.$item->id.'"/></td>';
		echo '<td>'.$item->name.'</td>';
		if($item->price == 0){
			echo '<td>时价</td>';
		}else{
			echo '<td>'.$item->price.'</td>';
		}
		echo '<td>';
		
		$result_bunddle_item = ORM::factory("bunddleItem")->where("bunddleid","=",$item->id)->and_where("status","=","A")->find_all();
		foreach ($result_bunddle_item as $subItem){
			echo $subItem->name.'<br/>';
		}
		
		echo '</td>';
		echo '<td>';
		if(!empty($item->picture)){
			echo '<a target="_blank" href="'.URL::base().BUNDDLE_IMG_PATH.$item->picture.'"><img src="'.URL::base().BUNDDLE_IMG_PATH.$item->picture.'" width="100ps" /></a></td>';
		}
		echo '<td>'.$item->desc.'</td>';
		echo '<td><a style="color:blue" title="修改" href="javascript:void(0)" onclick="editBunddle('.$item->id.')">修改</a>';
		echo '&nbsp;|&nbsp;';
		echo '<a style="color:blue" title="管理菜色" href="javascript:void(0)" onclick="showDishByBunddle('.$item->id.')">管理菜色</a>';
		echo '</td></tr>';
	}
	?>
	</tbody>
</table>
</div>
<button id="create-bunddle">增加套餐</button>
<button id="delete-bunddle">删除选中套餐</button>